@fro.bot/systematic 3.25.1 → 3.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HARNESSES.md +49 -1
- package/README.md +1 -1
- package/dist/ce-review-validator.d.ts +22 -3
- package/dist/cli.js +69 -34
- package/dist/{index-bmsgc2em.js → index-1dyb2x0z.js} +1 -0
- package/dist/index.js +1 -1
- package/dist/lib/bundled-names.d.ts +1 -1
- package/dist/lib/review-artifact-path.d.ts +66 -0
- package/dist/lib/review-artifact-schema.d.ts +12 -0
- package/dist/lib/review-pipeline.d.ts +25 -17
- package/dist/lib/review-return-validator.d.ts +3 -6
- package/dist/pi.js +1 -0
- package/package.json +2 -1
- package/skills/ce-review/SKILL.md +2 -2
- package/skills/ce-review/references/pipeline-invocation.md +36 -1
- package/skills/ce-review/references/review-pipeline-schema.json +3 -3
- package/skills/ce-review/references/review-summary-schema.json +12 -12
- package/skills/ce-review/references/validator-template.md +12 -11
- package/skills/ce-review/scripts/validate-review.mjs +355 -136
- package/skills/git-commit-push-pr/SKILL.md +79 -6
- package/skills/pr-attachments/SKILL.md +764 -0
- package/skills/pr-attachments/scripts/pr-attachments.mjs +3140 -0
package/HARNESSES.md
CHANGED
|
@@ -43,7 +43,7 @@ Every export/refresh/cleanup operation walks every path component from a scope-a
|
|
|
43
43
|
|
|
44
44
|
The package manifest exposes the extension and skills at `package.json:17-23` (and the packaged personas at `package.json:24-28`), with tests verifying both manifest entries and their packaged paths `tests/unit/package-exports.test.ts:64-84,268-288` [PI-4]. Pi's RPC/JSONL test fixture isolates its environment (`tests/integration/pi.test.ts:349-388`), and the installed runtime exposes environment-specific agent/session directories `node_modules/@earendil-works/pi-coding-agent/dist/config.js:396-398` [PI-5].
|
|
45
45
|
|
|
46
|
-
Pi honors Systematic's disable settings. `src/pi.ts` loads the merged config once at extension start and passes `disabled_skills` to the skill resolver, so a disabled skill is absent from the `systematic_skill` description and parameter hint and fails to load as unknown. It filters the `systematic_delegate` catalog with `isAgentDisabled`, so a persona disabled by `disabled_agents` (bare name or `category/name`) or by an `agents.<name>.disable` overlay disappears from the tool's description, hint and lookup. The pi-subagents export applies the same predicate, and `tests/unit/disable-parity.test.ts` pins it to what OpenCode's config handler omits [PI-6]. Settings are read at extension start, so a Pi restart applies a change. Pi's own skill discovery is a separate path: `pi.skills` ships the whole `./skills` directory and Pi's `/skill:name` commands, so those still list and load disabled skills [PI-4], [PI-5]. Pi's skill loading also has no OpenCode-style permission gate — OpenCode's `skill-tool.ts` calls `context.ask({ permission: 'skill', ... })` before returning skill content, but Pi 0.80.6's extension API has no equivalent hook and Systematic's Pi tool implementation does not call one [PI-6]. Those are deliberate honesty boundaries, not implied parity.
|
|
46
|
+
Pi honors Systematic's disable settings. `src/pi.ts` loads the merged config once at extension start and passes `disabled_skills` to the skill resolver, so a disabled skill is absent from the `systematic_skill` description and parameter hint and fails to load as unknown. It filters the `systematic_delegate` catalog with `isAgentDisabled`, so a persona disabled by `disabled_agents` (bare name or `category/name`) or by an `agents.<name>.disable` overlay disappears from the tool's description, hint and lookup. The pi-subagents export applies the same predicate, and `tests/unit/disable-parity.test.ts` pins it to what OpenCode's config handler omits [PI-6]. Settings are read at extension start, so a Pi restart applies a change. Pi's `systematic_skill` takes a single `name` parameter and no arguments (`src/pi.ts:215-219`) [PI-3], so a skill that needs arguments, such as `mode:embed` and image paths for `pr-attachments`, reads them from the invoking instruction text instead; OpenCode and Claude Code can also pass skill arguments. Pi's own skill discovery is a separate path: `pi.skills` ships the whole `./skills` directory and Pi's `/skill:name` commands, so those still list and load disabled skills [PI-4], [PI-5]. Pi's skill loading also has no OpenCode-style permission gate — OpenCode's `skill-tool.ts` calls `context.ask({ permission: 'skill', ... })` before returning skill content, but Pi 0.80.6's extension API has no equivalent hook and Systematic's Pi tool implementation does not call one [PI-6]. Those are deliberate honesty boundaries, not implied parity.
|
|
47
47
|
|
|
48
48
|
## Claude Code — Tier 1 shipped adapter
|
|
49
49
|
|
|
@@ -90,6 +90,51 @@ layouts are proven by package-tree execution under real Node, not by running the
|
|
|
90
90
|
harness. This is package-tree execution plus one real OpenCode scripted host,
|
|
91
91
|
not cross-harness runtime parity.
|
|
92
92
|
|
|
93
|
+
## PR attachments helper — packaged paths
|
|
94
|
+
|
|
95
|
+
The `pr-attachments` skill ships one self-contained Node helper,
|
|
96
|
+
`skills/pr-attachments/scripts/pr-attachments.mjs`. It imports only `node:` builtins and has no
|
|
97
|
+
relative imports. Eight subcommands (`classify`, `splice`, `extract`, `urls`, `repin-rewrite`,
|
|
98
|
+
`pins`, `cleanup-set`, `verify`) each read one JSON object on stdin and write one JSON object on
|
|
99
|
+
stdout, with exit code 0 for success, 1 for a domain failure and 2 for a usage error. The skill
|
|
100
|
+
invokes the helper as `node "$SKILL_DIR/scripts/pr-attachments.mjs"`, so the file mode bit is not
|
|
101
|
+
part of the contract. The helper needs `node` 18+ on PATH. A Bun-only OpenCode install does not
|
|
102
|
+
have it, and the skill stops with its state reported rather than running the helper's work by hand.
|
|
103
|
+
Recorded execution evidence for this surface:
|
|
104
|
+
|
|
105
|
+
- **npm / OpenCode / Pi package layout** — real Node execution from an extracted
|
|
106
|
+
`npm pack --ignore-scripts` archive, resolving the helper through its packaged
|
|
107
|
+
`skills/pr-attachments` directory [PA-1].
|
|
108
|
+
- **OCX-selected tree** — real Node execution from the `pr-attachments` component's declared file
|
|
109
|
+
selection, with a negative control for a selection that omits the helper [PA-1].
|
|
110
|
+
- **Claude Code generated bundle** — real Node execution from the output written by
|
|
111
|
+
`generatePluginFiles`/`writePluginFiles`, with the helper byte-identical to source [PA-1].
|
|
112
|
+
- **Skill contract** — `SKILL.md` is parsed as data: the mode and dispatch tables, the `SKILL_DIR`
|
|
113
|
+
anchor in every fenced block, the publishing order, and the bans on force-pushes, blanket staging,
|
|
114
|
+
inline bodies and hand-run `git rm` [PA-2].
|
|
115
|
+
- **Offline dry run** — the fenced blocks of `SKILL.md` run against a temporary repository with a
|
|
116
|
+
local bare remote and the real helper: the pathspec commit, the file-set assertion, the explicit
|
|
117
|
+
refspec push, the rejected non-fast-forward push, carry mode and cleanup [PA-3]. Git attributes are
|
|
118
|
+
covered the same way: `docs/evidence/** text eol=lf` stops at the guard, `core.autocrlf` and a
|
|
119
|
+
rewriting commit hook are caught by the staged and committed blob checks, and none of them reaches
|
|
120
|
+
the remote. A merge that resolved an image selects the merge as the pin, not its parent. The
|
|
121
|
+
private-repository blob check runs against a stand-in `gh` that answers from the local repository:
|
|
122
|
+
match, mismatch, absent file, bounded retries and the `local` expectation used by re-pin mode.
|
|
123
|
+
|
|
124
|
+
One live OpenCode session ran a build of this branch, loaded as a `file://` plugin with isolated
|
|
125
|
+
config and no user-global plugins. It loaded `systematic:pr-attachments` through `systematic_skill`,
|
|
126
|
+
ran `classify` against a public pull request, and asked the scrub confirmation before any commit or
|
|
127
|
+
push. It stopped there. The remote branch and the pull request body were unchanged afterwards. The
|
|
128
|
+
PR flow, re-pin, the `--body-file` round trip and the private-repository blob form were also run by
|
|
129
|
+
hand against real GitHub repositories, which exercised GitHub's raw-content serving. None of that
|
|
130
|
+
live evidence is reproduced by the test suite.
|
|
131
|
+
|
|
132
|
+
The offline dry run uses no real `gh` and no network. The helper's `verify` subcommand is tested
|
|
133
|
+
against a local HTTP server (`tests/unit/pr-attachments-verify.test.ts`). No live Pi, OCX or Claude
|
|
134
|
+
Code host was executed. `SKILL_DIR` resolution on Pi and Claude Code is evidenced from the package
|
|
135
|
+
tree only. These layouts are proven by package-tree execution under real Node and by a scripted run
|
|
136
|
+
of the skill's own commands, plus one live OpenCode run, not cross-harness runtime parity.
|
|
137
|
+
|
|
93
138
|
## Codex CLI — Tier 2 documented portability target
|
|
94
139
|
|
|
95
140
|
The supplied evidence verifies only `request_user_input`: its definition names the tool [CX-1], and its handler blocks while restricting use to the root thread, rejecting subagents [CX-2]. Delegation, task tracking, skill loading, and skills-file support were not checked and remain **UNVERIFIED**. Systematic ships no Codex adapter or profile.
|
|
@@ -157,3 +202,6 @@ Migrated-skill discipline is enforced by the [content-integrity gate](scripts/co
|
|
|
157
202
|
- **GH-8** — [Copilot `AGENTS.md` support](https://github.blog/changelog/2025-08-28-copilot-coding-agent-now-supports-agents-md-custom-instructions/).
|
|
158
203
|
- **RV-1** — `tests/unit/ce-review-validator-packaging.test.ts` (real Node execution from the npm/OpenCode/Pi package tree, the OCX-selected tree, and the Claude Code generated bundle).
|
|
159
204
|
- **RV-2** — `tests/integration/ce-review-return-validation.test.ts` (real OpenCode scripted host invoking the packaged `skills/ce-review/scripts/validate-review.mjs` through its `SKILL_DIR` anchor).
|
|
205
|
+
- **PA-1** — `tests/unit/pr-attachments-packaging.test.ts` (real Node execution of `skills/pr-attachments/scripts/pr-attachments.mjs` from the npm-packed archive, the OCX-selected tree and the Claude Code generated bundle; nothing under `docs/evidence/` ships).
|
|
206
|
+
- **PA-2** — `tests/unit/pr-attachments-contract.test.ts` (`skills/pr-attachments/SKILL.md` contract: modes, argument dispatch, `SKILL_DIR` anchor, publishing order, bans).
|
|
207
|
+
- **PA-3** — `tests/unit/pr-attachments-dry-run.test.ts` (the skill's fenced blocks run offline against a temporary repository and a local bare remote, with the real helper).
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ You want AI that follows your process, not just your prompts. You want repeatabl
|
|
|
29
29
|
|
|
30
30
|
## What You Get
|
|
31
31
|
|
|
32
|
-
Systematic is a compound-engineering loop: brainstorm, plan, work, review — each phase a structured skill that guides the AI through requirements exploration, implementation planning, execution, and code review, capturing what was learned along the way. It ships
|
|
32
|
+
Systematic is a compound-engineering loop: brainstorm, plan, work, review — each phase a structured skill that guides the AI through requirements exploration, implementation planning, execution, and code review, capturing what was learned along the way. It ships 33 bundled skills and 37 specialized agents for architecture, security, performance, design, and code review.
|
|
33
33
|
|
|
34
34
|
The workflow runs on three harnesses from one source: [OpenCode](https://opencode.ai/), [Pi](https://github.com/earendil-works/pi-coding-agent), and Claude Code. Each gets a native install path; skill and agent content is identical across all three.
|
|
35
35
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SchemaRejection } from './lib/review-pipeline.js';
|
|
1
2
|
import { type ReadChunk } from './lib/review-return-validator.js';
|
|
2
3
|
/**
|
|
3
4
|
* Entry point for the generated, self-contained `ce:review` skill-local
|
|
@@ -35,21 +36,21 @@ export declare const CE_REVIEW_SCREEN_INTERNAL_ERROR_MESSAGE = "ce-review-valida
|
|
|
35
36
|
export declare const CE_REVIEW_PREPARE_USAGE = "Usage: node validate-review.mjs prepare";
|
|
36
37
|
export declare const CE_REVIEW_PREPARE_STDIN_TTY_MESSAGE = "prepare reads one aggregate JSON envelope from stdin; interactive input is not supported";
|
|
37
38
|
export declare const CE_REVIEW_PREPARE_STDIN_READ_FAILED_MESSAGE = "prepare could not read the aggregate envelope from stdin";
|
|
38
|
-
export declare const CE_REVIEW_PREPARE_STDIN_OVERSIZED_MESSAGE = "prepare input exceeds the aggregate byte cap";
|
|
39
|
+
export declare const CE_REVIEW_PREPARE_STDIN_OVERSIZED_MESSAGE = "prepare input exceeds the aggregate byte cap (16842752 bytes)";
|
|
39
40
|
export declare const CE_REVIEW_PREPARE_STDIN_INVALID_UTF8_MESSAGE = "prepare input is not valid UTF-8";
|
|
40
41
|
export declare const CE_REVIEW_PREPARE_STDIN_EMPTY_MESSAGE = "prepare received empty stdin";
|
|
41
42
|
export declare const CE_REVIEW_PREPARE_REJECTED_MESSAGE = "prepare rejected the aggregate envelope";
|
|
42
43
|
export declare const CE_REVIEW_MERGE_USAGE = "Usage: node validate-review.mjs merge";
|
|
43
44
|
export declare const CE_REVIEW_MERGE_STDIN_TTY_MESSAGE = "merge reads one aggregate JSON envelope from stdin; interactive input is not supported";
|
|
44
45
|
export declare const CE_REVIEW_MERGE_STDIN_READ_FAILED_MESSAGE = "merge could not read the aggregate envelope from stdin";
|
|
45
|
-
export declare const CE_REVIEW_MERGE_STDIN_OVERSIZED_MESSAGE = "merge input exceeds the aggregate byte cap";
|
|
46
|
+
export declare const CE_REVIEW_MERGE_STDIN_OVERSIZED_MESSAGE = "merge input exceeds the aggregate byte cap (16842752 bytes)";
|
|
46
47
|
export declare const CE_REVIEW_MERGE_STDIN_INVALID_UTF8_MESSAGE = "merge input is not valid UTF-8";
|
|
47
48
|
export declare const CE_REVIEW_MERGE_STDIN_EMPTY_MESSAGE = "merge received empty stdin";
|
|
48
49
|
export declare const CE_REVIEW_MERGE_REJECTED_MESSAGE = "merge rejected the aggregate envelope";
|
|
49
50
|
export declare const CE_REVIEW_FINALIZE_USAGE = "Usage: node validate-review.mjs finalize";
|
|
50
51
|
export declare const CE_REVIEW_FINALIZE_STDIN_TTY_MESSAGE = "finalize reads one aggregate JSON envelope from stdin; interactive input is not supported";
|
|
51
52
|
export declare const CE_REVIEW_FINALIZE_STDIN_READ_FAILED_MESSAGE = "finalize could not read the aggregate envelope from stdin";
|
|
52
|
-
export declare const CE_REVIEW_FINALIZE_STDIN_OVERSIZED_MESSAGE = "finalize input exceeds the aggregate byte cap";
|
|
53
|
+
export declare const CE_REVIEW_FINALIZE_STDIN_OVERSIZED_MESSAGE = "finalize input exceeds the aggregate byte cap (16842752 bytes)";
|
|
53
54
|
export declare const CE_REVIEW_FINALIZE_STDIN_INVALID_UTF8_MESSAGE = "finalize input is not valid UTF-8";
|
|
54
55
|
export declare const CE_REVIEW_FINALIZE_STDIN_EMPTY_MESSAGE = "finalize received empty stdin";
|
|
55
56
|
export declare const CE_REVIEW_FINALIZE_REJECTED_MESSAGE = "finalize rejected the aggregate envelope";
|
|
@@ -61,4 +62,22 @@ export interface CeReviewValidatorOptions {
|
|
|
61
62
|
readonly outputSink?: (message: string) => void;
|
|
62
63
|
readonly errorSink?: (message: string) => void;
|
|
63
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Bounded, payload-safe rejection message. A schema rejection is the fixed
|
|
67
|
+
* context line `<phase> rejected the aggregate envelope: <reason>`, then up
|
|
68
|
+
* to eight `path code` lines and `… and N more` when there are more. A domain
|
|
69
|
+
* rejection is one line, `<context>: <reason> at <path>`. `reason` is a
|
|
70
|
+
* fixed-vocabulary string from the pipeline, `path` is a safe JSON pointer,
|
|
71
|
+
* and `code` is a Zod issue code; never payload content or an issue message.
|
|
72
|
+
*
|
|
73
|
+
* @internal Exported for tests.
|
|
74
|
+
*/
|
|
75
|
+
export declare function formatAggregateRejection(rejectedMessage: string, rejection: AggregateRejection): string;
|
|
76
|
+
/** A rejection the aggregate subcommands can print: a schema failure with its
|
|
77
|
+
* projected issues, or a domain failure with a fixed reason and a safe path. */
|
|
78
|
+
export type AggregateRejection = SchemaRejection<string> | {
|
|
79
|
+
readonly kind: 'domain';
|
|
80
|
+
readonly path: string;
|
|
81
|
+
readonly reason: string;
|
|
82
|
+
};
|
|
64
83
|
export declare function runCeReviewValidator(options: CeReviewValidatorOptions): number;
|
package/dist/cli.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
findCommandsInDir,
|
|
36
36
|
findSkillsInDir,
|
|
37
37
|
discoverSkills
|
|
38
|
-
} from "./index-
|
|
38
|
+
} from "./index-1dyb2x0z.js";
|
|
39
39
|
var __defProp = Object.defineProperty;
|
|
40
40
|
var __returnValue = (v) => v;
|
|
41
41
|
function __exportSetter(name, newValue) {
|
|
@@ -2121,6 +2121,39 @@ function formatReviewArtifactIssuePath(issuePath) {
|
|
|
2121
2121
|
return "$";
|
|
2122
2122
|
return issuePath.map((segment) => typeof segment === "number" ? String(segment) : segment).join(".");
|
|
2123
2123
|
}
|
|
2124
|
+
var MAX_PROJECTED_ISSUE_LINES = 8;
|
|
2125
|
+
function projectZodIssues(issues, max = MAX_PROJECTED_ISSUE_LINES) {
|
|
2126
|
+
return {
|
|
2127
|
+
issues: issues.slice(0, max).map((issue) => ({
|
|
2128
|
+
path: formatReviewArtifactIssuePath(issue.path),
|
|
2129
|
+
code: issue.code
|
|
2130
|
+
})),
|
|
2131
|
+
total: issues.length
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
var REVIEW_ARTIFACT_SCHEMA_RELATIVE_PATH = "skills/ce-review/references/review-summary-schema.json";
|
|
2135
|
+
function formatProjectedIssueLines(projected) {
|
|
2136
|
+
const lines = projected.issues.map((issue) => `${issue.path} ${issue.code}`);
|
|
2137
|
+
const omitted = projected.total - projected.issues.length;
|
|
2138
|
+
if (omitted > 0)
|
|
2139
|
+
lines.push(`\u2026 and ${omitted} more`);
|
|
2140
|
+
return lines;
|
|
2141
|
+
}
|
|
2142
|
+
function formatReviewArtifactValidationFailure(issues) {
|
|
2143
|
+
const projected = projectZodIssues(issues);
|
|
2144
|
+
const issueLines = formatProjectedIssueLines(projected);
|
|
2145
|
+
const shown = projected.issues.length;
|
|
2146
|
+
for (const [index, issue] of issues.slice(0, shown).entries()) {
|
|
2147
|
+
if (issue.code === "custom" && issue.message !== undefined) {
|
|
2148
|
+
issueLines[index] = `${issueLines[index]}: ${issue.message}`;
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
return [
|
|
2152
|
+
`Review artifact failed schema validation: ${projected.total} issue(s)`,
|
|
2153
|
+
`Schema: ${REVIEW_ARTIFACT_SCHEMA_RELATIVE_PATH}`,
|
|
2154
|
+
...issueLines
|
|
2155
|
+
];
|
|
2156
|
+
}
|
|
2124
2157
|
function readReviewArtifact(filePath) {
|
|
2125
2158
|
let content;
|
|
2126
2159
|
try {
|
|
@@ -2243,6 +2276,18 @@ var MAX_INPUT_ID_LENGTH = 128;
|
|
|
2243
2276
|
var MAX_REASON_LENGTH = 2048;
|
|
2244
2277
|
var MAX_FINDINGS = 32;
|
|
2245
2278
|
var MAX_PERSONAS = 64;
|
|
2279
|
+
var MAX_RUN_FINDINGS = MAX_FINDINGS * MAX_PERSONAS;
|
|
2280
|
+
var MAX_DECISION_FACTS = MAX_FINDINGS;
|
|
2281
|
+
var MAX_RUN_DISAGREEMENT_FACTS = MAX_RUN_FINDINGS * (MAX_DECISION_FACTS + 1);
|
|
2282
|
+
var COVERAGE_BOUNDS = {
|
|
2283
|
+
reviewers: MAX_PERSONAS,
|
|
2284
|
+
validators: MAX_RUN_FINDINGS,
|
|
2285
|
+
residual_risks: MAX_PERSONAS * MAX_PERSONAS,
|
|
2286
|
+
testing_gaps: MAX_PERSONAS * MAX_PERSONAS,
|
|
2287
|
+
failed_reviewers: MAX_PERSONAS,
|
|
2288
|
+
validator_failures: MAX_RUN_FINDINGS,
|
|
2289
|
+
intent_uncertainty: MAX_RUN_DISAGREEMENT_FACTS
|
|
2290
|
+
};
|
|
2246
2291
|
var REVIEW_ARTIFACT_CUSTOM_MESSAGES = [
|
|
2247
2292
|
"severity count must match rejected finding count",
|
|
2248
2293
|
"filtered findings require a validation reason",
|
|
@@ -2376,7 +2421,7 @@ var SynthesizedFindingFieldsSchema = object({
|
|
|
2376
2421
|
validated: boolean().optional(),
|
|
2377
2422
|
validation_reason: ReasonSchema.optional(),
|
|
2378
2423
|
route_narrowing_reason: ReasonSchema.optional(),
|
|
2379
|
-
input_finding_ids: array(boundedText(MAX_INPUT_ID_LENGTH)).min(1).max(
|
|
2424
|
+
input_finding_ids: array(boundedText(MAX_INPUT_ID_LENGTH)).min(1).max(MAX_RUN_FINDINGS),
|
|
2380
2425
|
provenance: ProvenanceSchema
|
|
2381
2426
|
}).strict();
|
|
2382
2427
|
var SynthesizedFindingSchema = SynthesizedFindingFieldsSchema.superRefine((finding, ctx) => {
|
|
@@ -2405,24 +2450,24 @@ var DispatchSchema = object({
|
|
|
2405
2450
|
}
|
|
2406
2451
|
});
|
|
2407
2452
|
var DispositionCountsSchema = object({
|
|
2408
|
-
surviving: number().int().nonnegative().max(
|
|
2409
|
-
merged: number().int().nonnegative().max(
|
|
2410
|
-
suppressed: number().int().nonnegative().max(
|
|
2411
|
-
filtered: number().int().nonnegative().max(
|
|
2412
|
-
rejected: number().int().nonnegative().max(
|
|
2453
|
+
surviving: number().int().nonnegative().max(MAX_RUN_FINDINGS),
|
|
2454
|
+
merged: number().int().nonnegative().max(MAX_RUN_FINDINGS),
|
|
2455
|
+
suppressed: number().int().nonnegative().max(MAX_RUN_FINDINGS),
|
|
2456
|
+
filtered: number().int().nonnegative().max(MAX_RUN_FINDINGS),
|
|
2457
|
+
rejected: number().int().nonnegative().max(MAX_RUN_FINDINGS)
|
|
2413
2458
|
}).strict();
|
|
2414
2459
|
var CoverageSchema = object({
|
|
2415
|
-
reviewers: number().int().nonnegative().max(
|
|
2416
|
-
validators: number().int().nonnegative().max(
|
|
2417
|
-
residual_risks: array(ReasonSchema).max(
|
|
2418
|
-
testing_gaps: array(ReasonSchema).max(
|
|
2419
|
-
failed_reviewers: array(ReviewerSchema).max(
|
|
2420
|
-
validator_failures: array(ReasonSchema).max(
|
|
2421
|
-
intent_uncertainty: array(ReasonSchema).max(
|
|
2460
|
+
reviewers: number().int().nonnegative().max(COVERAGE_BOUNDS.reviewers).optional(),
|
|
2461
|
+
validators: number().int().nonnegative().max(COVERAGE_BOUNDS.validators).optional(),
|
|
2462
|
+
residual_risks: array(ReasonSchema).max(COVERAGE_BOUNDS.residual_risks),
|
|
2463
|
+
testing_gaps: array(ReasonSchema).max(COVERAGE_BOUNDS.testing_gaps),
|
|
2464
|
+
failed_reviewers: array(ReviewerSchema).max(COVERAGE_BOUNDS.failed_reviewers),
|
|
2465
|
+
validator_failures: array(ReasonSchema).max(COVERAGE_BOUNDS.validator_failures),
|
|
2466
|
+
intent_uncertainty: array(ReasonSchema).max(COVERAGE_BOUNDS.intent_uncertainty)
|
|
2422
2467
|
}).strict();
|
|
2423
2468
|
var DeclinedMergeSchema = object({
|
|
2424
2469
|
file: RepoRelativePathSchema,
|
|
2425
|
-
input_finding_ids: array(boundedText(MAX_INPUT_ID_LENGTH)).min(2).max(
|
|
2470
|
+
input_finding_ids: array(boundedText(MAX_INPUT_ID_LENGTH)).min(2).max(MAX_RUN_FINDINGS),
|
|
2426
2471
|
reason: ReasonSchema
|
|
2427
2472
|
}).strict();
|
|
2428
2473
|
var ValidationSchema = object({
|
|
@@ -2485,14 +2530,14 @@ var ReviewArtifactSchema = object({
|
|
|
2485
2530
|
verdict: boundedText(256),
|
|
2486
2531
|
completed_at: CompletedAtSchema,
|
|
2487
2532
|
dispatches: array(DispatchSchema).max(MAX_PERSONAS),
|
|
2488
|
-
input_findings: array(InputFindingSchema).max(
|
|
2489
|
-
findings: array(SynthesizedFindingSchema).max(
|
|
2490
|
-
declined_merges: array(DeclinedMergeSchema).max(
|
|
2533
|
+
input_findings: array(InputFindingSchema).max(MAX_RUN_FINDINGS),
|
|
2534
|
+
findings: array(SynthesizedFindingSchema).max(MAX_RUN_FINDINGS),
|
|
2535
|
+
declined_merges: array(DeclinedMergeSchema).max(MAX_RUN_FINDINGS).optional(),
|
|
2491
2536
|
risk_coverage: array(RiskCoverageSchema).max(MAX_PERSONAS).optional(),
|
|
2492
2537
|
disposition_counts: DispositionCountsSchema,
|
|
2493
|
-
applied_fixes: array(ReasonSchema).max(
|
|
2494
|
-
residual_actionable_work: array(ReasonSchema).max(
|
|
2495
|
-
advisory_outputs: array(ReasonSchema).max(
|
|
2538
|
+
applied_fixes: array(ReasonSchema).max(MAX_RUN_FINDINGS),
|
|
2539
|
+
residual_actionable_work: array(ReasonSchema).max(MAX_RUN_FINDINGS),
|
|
2540
|
+
advisory_outputs: array(ReasonSchema).max(MAX_RUN_FINDINGS),
|
|
2496
2541
|
coverage: CoverageSchema,
|
|
2497
2542
|
validation: ValidationSchema.optional()
|
|
2498
2543
|
}).strict().superRefine((artifact, ctx) => {
|
|
@@ -2716,7 +2761,6 @@ var ParentRecordSchema = object({
|
|
|
2716
2761
|
import fs5 from "fs";
|
|
2717
2762
|
var VALIDATE_REVIEW_RETURN_USAGE = "Usage: systematic validate-review-return";
|
|
2718
2763
|
var MAX_REVIEW_RETURN_BYTES = 1024 * 1024;
|
|
2719
|
-
var MAX_PROJECTED_ISSUE_LINES = 8;
|
|
2720
2764
|
var REVIEW_RETURN_VALID_MESSAGE = "Review return is valid";
|
|
2721
2765
|
var REVIEW_RETURN_EMPTY_MESSAGE = "Review return is empty";
|
|
2722
2766
|
var REVIEW_RETURN_INVALID_UTF8_MESSAGE = "Review return is not valid UTF-8";
|
|
@@ -2728,11 +2772,7 @@ function validateReviewReturnValue(value) {
|
|
|
2728
2772
|
const result = SubAgentReturnSchema.safeParse(value);
|
|
2729
2773
|
if (result.success)
|
|
2730
2774
|
return { ok: true };
|
|
2731
|
-
const total = result.error.issues
|
|
2732
|
-
const issues = result.error.issues.slice(0, MAX_PROJECTED_ISSUE_LINES).map((issue) => ({
|
|
2733
|
-
path: formatReviewArtifactIssuePath(issue.path),
|
|
2734
|
-
code: issue.code
|
|
2735
|
-
}));
|
|
2775
|
+
const { issues, total } = projectZodIssues(result.error.issues);
|
|
2736
2776
|
return { issues, ok: false, total };
|
|
2737
2777
|
}
|
|
2738
2778
|
function formatReviewReturnValidationFailure(total) {
|
|
@@ -3236,7 +3276,6 @@ Scope:
|
|
|
3236
3276
|
project <cwd>/.pi/agents (default)
|
|
3237
3277
|
global $PI_CODING_AGENT_DIR/agents or ~/.pi/agent/agents
|
|
3238
3278
|
`;
|
|
3239
|
-
var REVIEW_ARTIFACT_SCHEMA_RELATIVE_PATH = "skills/ce-review/references/review-summary-schema.json";
|
|
3240
3279
|
function defaultCapabilityRoots() {
|
|
3241
3280
|
const configDir = process.env.XDG_CONFIG_HOME ? path5.join(process.env.XDG_CONFIG_HOME, "opencode") : path5.join(os2.homedir(), ".config/opencode");
|
|
3242
3281
|
return {
|
|
@@ -3422,13 +3461,9 @@ function runValidateReviewArtifact(options) {
|
|
|
3422
3461
|
}
|
|
3423
3462
|
const result = ReviewArtifactSchema.safeParse(artifact.value);
|
|
3424
3463
|
if (!result.success) {
|
|
3425
|
-
for (const
|
|
3426
|
-
|
|
3427
|
-
const authoredMessage = issue.code === "custom" ? `: ${issue.message}` : "";
|
|
3428
|
-
errorSink(`${issuePath} ${issue.code}${authoredMessage}`);
|
|
3464
|
+
for (const line of formatReviewArtifactValidationFailure(result.error.issues)) {
|
|
3465
|
+
errorSink(line);
|
|
3429
3466
|
}
|
|
3430
|
-
errorSink(`Schema: ${REVIEW_ARTIFACT_SCHEMA_RELATIVE_PATH}`);
|
|
3431
|
-
errorSink(`Review artifact validation failed: ${result.error.issues.length} issue(s)`);
|
|
3432
3467
|
return 1;
|
|
3433
3468
|
}
|
|
3434
3469
|
outputSink(formatReviewArtifactSuccessMessage(parsedArgs.allowOutsideArtifactRoot));
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const BUNDLED_AGENT_NAMES: readonly ['adversarial-document-reviewer', 'adversarial-reviewer', 'agent-native-reviewer', 'api-contract-reviewer', 'architecture-strategist', 'best-practices-researcher', 'bug-reproduction-validator', 'cli-readiness-reviewer', 'code-simplicity-reviewer', 'coherence-reviewer', 'correctness-reviewer', 'data-migrations-reviewer', 'deployment-verification-agent', 'design-iterator', 'design-lens-reviewer', 'feasibility-reviewer', 'framework-docs-researcher', 'git-history-analyzer', 'issue-intelligence-analyst', 'kieran-typescript-reviewer', 'learnings-researcher', 'maintainability-reviewer', 'pattern-recognition-specialist', 'performance-reviewer', 'pr-comment-resolver', 'previous-comments-reviewer', 'product-lens-reviewer', 'project-standards-reviewer', 'reliability-reviewer', 'repo-research-analyst', 'scope-guardian-reviewer', 'security-lens-reviewer', 'security-reviewer', 'slack-researcher', 'spec-flow-analyzer', 'systematic-implementer', 'testing-reviewer'];
|
|
2
2
|
export declare const BUNDLED_AGENT_QUALIFIED_IDS: readonly ['design/design-iterator', 'document-review/adversarial-document-reviewer', 'document-review/coherence-reviewer', 'document-review/design-lens-reviewer', 'document-review/feasibility-reviewer', 'document-review/product-lens-reviewer', 'document-review/scope-guardian-reviewer', 'document-review/security-lens-reviewer', 'research/best-practices-researcher', 'research/framework-docs-researcher', 'research/git-history-analyzer', 'research/issue-intelligence-analyst', 'research/learnings-researcher', 'research/repo-research-analyst', 'research/slack-researcher', 'review/adversarial-reviewer', 'review/agent-native-reviewer', 'review/api-contract-reviewer', 'review/architecture-strategist', 'review/cli-readiness-reviewer', 'review/code-simplicity-reviewer', 'review/correctness-reviewer', 'review/data-migrations-reviewer', 'review/deployment-verification-agent', 'review/kieran-typescript-reviewer', 'review/maintainability-reviewer', 'review/pattern-recognition-specialist', 'review/performance-reviewer', 'review/previous-comments-reviewer', 'review/project-standards-reviewer', 'review/reliability-reviewer', 'review/security-reviewer', 'review/testing-reviewer', 'workflow/bug-reproduction-validator', 'workflow/pr-comment-resolver', 'workflow/spec-flow-analyzer', 'workflow/systematic-implementer'];
|
|
3
|
-
export declare const BUNDLED_SKILL_NAMES: readonly ['agent-browser', 'agent-native-architecture', 'agent-native-audit', 'ce:brainstorm', 'ce:compound', 'ce:compound-refresh', 'ce:ideate', 'ce:plan', 'ce:review', 'ce:review-cleanup', 'ce:work', 'compound-docs', 'deepen-plan', 'deploy-docs', 'document-review', 'frontend-design', 'git-clean-gone-branches', 'git-commit', 'git-commit-push-pr', 'git-worktree', 'lfg', 'onboarding', 'orchestrating-subagents', 'report-bug-ce', 'reproduce-bug', 'resolve-pr-feedback', 'slfg', 'test-browser', 'test-driven-development', 'todos', 'using-systematic', 'writing-skills'];
|
|
3
|
+
export declare const BUNDLED_SKILL_NAMES: readonly ['agent-browser', 'agent-native-architecture', 'agent-native-audit', 'ce:brainstorm', 'ce:compound', 'ce:compound-refresh', 'ce:ideate', 'ce:plan', 'ce:review', 'ce:review-cleanup', 'ce:work', 'compound-docs', 'deepen-plan', 'deploy-docs', 'document-review', 'frontend-design', 'git-clean-gone-branches', 'git-commit', 'git-commit-push-pr', 'git-worktree', 'lfg', 'onboarding', 'orchestrating-subagents', 'pr-attachments', 'report-bug-ce', 'reproduce-bug', 'resolve-pr-feedback', 'slfg', 'test-browser', 'test-driven-development', 'todos', 'using-systematic', 'writing-skills'];
|
|
4
4
|
export type BundledAgentName = (typeof BUNDLED_AGENT_NAMES)[number];
|
|
5
5
|
export type BundledSkillName = (typeof BUNDLED_SKILL_NAMES)[number];
|
|
@@ -13,6 +13,72 @@ export type ReadArtifactResult = {
|
|
|
13
13
|
readonly message: string;
|
|
14
14
|
};
|
|
15
15
|
export declare function formatReviewArtifactIssuePath(issuePath: readonly PropertyKey[]): string;
|
|
16
|
+
/** Maximum number of projected issues emitted before the total. */
|
|
17
|
+
export declare const MAX_PROJECTED_ISSUE_LINES = 8;
|
|
18
|
+
/** One bounded, payload-safe projected validation issue: a safe path and an
|
|
19
|
+
* issue code, never a message, a value, or an unrecognized key name. */
|
|
20
|
+
export interface ProjectedIssue {
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly code: string;
|
|
23
|
+
}
|
|
24
|
+
/** The structural shape of a validation issue the projector reads. A Zod
|
|
25
|
+
* issue satisfies it; this module does not import Zod, so the input is typed
|
|
26
|
+
* by the two fields that are projected. */
|
|
27
|
+
export interface ProjectableIssue {
|
|
28
|
+
readonly path: readonly PropertyKey[];
|
|
29
|
+
readonly code: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ProjectedIssues {
|
|
32
|
+
readonly issues: readonly ProjectedIssue[];
|
|
33
|
+
/** The full issue count, even when {@link ProjectedIssues.issues} is capped. */
|
|
34
|
+
readonly total: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Projects at most `max` issues to `{path, code}` pairs plus the full count.
|
|
38
|
+
* Only the path and the code are read, so no issue message, payload value or
|
|
39
|
+
* unrecognized key name can reach the projection.
|
|
40
|
+
*/
|
|
41
|
+
export declare function projectZodIssues(issues: readonly ProjectableIssue[], max?: number): ProjectedIssues;
|
|
42
|
+
/** A payload-safe schema rejection: a fixed reason code, the first issue's
|
|
43
|
+
* safe path, up to {@link MAX_PROJECTED_ISSUE_LINES} projected `{path, code}`
|
|
44
|
+
* issues and the full issue count. Never a message, a value or an
|
|
45
|
+
* unrecognized key name. */
|
|
46
|
+
export interface SchemaRejection<Reason extends string> {
|
|
47
|
+
readonly kind: 'schema';
|
|
48
|
+
readonly path: string;
|
|
49
|
+
readonly reason: Reason;
|
|
50
|
+
readonly issues: readonly ProjectedIssue[];
|
|
51
|
+
readonly total: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Builds a schema rejection from a failed parse's issues. The path is the
|
|
55
|
+
* first issue's path, or the root `$` when there is none. Every surface that
|
|
56
|
+
* reports a schema failure builds it here, so that rule has one owner.
|
|
57
|
+
*/
|
|
58
|
+
export declare function schemaRejection<Reason extends string>(reason: Reason, zodIssues: readonly ProjectableIssue[]): SchemaRejection<Reason>;
|
|
59
|
+
/** The repository-relative path of the published review-summary schema,
|
|
60
|
+
* named in every artifact validation failure. */
|
|
61
|
+
export declare const REVIEW_ARTIFACT_SCHEMA_RELATIVE_PATH = "skills/ce-review/references/review-summary-schema.json";
|
|
62
|
+
/** The `path code` lines of a projection, then `… and N more` when the
|
|
63
|
+
* projection was capped. Pure formatting: nothing but the two projected
|
|
64
|
+
* fields reaches a line. */
|
|
65
|
+
export declare function formatProjectedIssueLines(projected: ProjectedIssues): string[];
|
|
66
|
+
/** A validation issue as the artifact validators format it: the projected
|
|
67
|
+
* path and code, plus the message, which is read only for a `custom` code. */
|
|
68
|
+
export interface ArtifactValidationIssue extends ProjectableIssue {
|
|
69
|
+
readonly message?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The lines both artifact validators print for a schema failure: a context
|
|
73
|
+
* line that carries the full issue count, the published schema's path, up to
|
|
74
|
+
* {@link MAX_PROJECTED_ISSUE_LINES} `path code` lines, then `… and N more`.
|
|
75
|
+
*
|
|
76
|
+
* A `custom` issue keeps its message. Those messages are the closed,
|
|
77
|
+
* author-written set in `REVIEW_ARTIFACT_CUSTOM_MESSAGES`
|
|
78
|
+
* (`tests/unit/review-artifact-schema.test.ts` enforces it), never text
|
|
79
|
+
* derived from the payload. Every other issue's message is dropped.
|
|
80
|
+
*/
|
|
81
|
+
export declare function formatReviewArtifactValidationFailure(issues: readonly ArtifactValidationIssue[]): string[];
|
|
16
82
|
export declare function readReviewArtifact(filePath: string): ReadArtifactResult;
|
|
17
83
|
export declare function isLegacyReviewArtifact(value: unknown): boolean;
|
|
18
84
|
export declare function hasParentDirectoryTraversal(input: string): boolean;
|
|
@@ -3,6 +3,18 @@ export declare const MAX_INPUT_ID_LENGTH = 128;
|
|
|
3
3
|
export declare const MAX_REASON_LENGTH = 2048;
|
|
4
4
|
export declare const MAX_FINDINGS = 32;
|
|
5
5
|
export declare const MAX_PERSONAS = 64;
|
|
6
|
+
export declare const MAX_RUN_FINDINGS: number;
|
|
7
|
+
export declare const MAX_DECISION_FACTS = 32;
|
|
8
|
+
export declare const MAX_RUN_DISAGREEMENT_FACTS: number;
|
|
9
|
+
export declare const COVERAGE_BOUNDS: {
|
|
10
|
+
readonly reviewers: 64;
|
|
11
|
+
readonly validators: number;
|
|
12
|
+
readonly residual_risks: number;
|
|
13
|
+
readonly testing_gaps: number;
|
|
14
|
+
readonly failed_reviewers: 64;
|
|
15
|
+
readonly validator_failures: number;
|
|
16
|
+
readonly intent_uncertainty: number;
|
|
17
|
+
};
|
|
6
18
|
export declare const REVIEW_ARTIFACT_CUSTOM_MESSAGES: readonly ['severity count must match rejected finding count', 'filtered findings require a validation reason', 'risk-critical dispatches require a non-empty selection surface', 'satisfied risk coverage requires a citing input finding ID', 'unsatisfied risk coverage must not cite an input finding ID', 'passed validation must not include a reason; non-passed validation requires a reason', 'validation_unavailable dispatches must record zero input findings', 'a completed run must not contain validation_unavailable evidence', 'a validation_unavailable persona must not have an input finding', 'every synthesized input finding ID must resolve to an admitted ledger row', 'every provenance submitter must be represented by a cited admitted ledger row', 'satisfied risk coverage must cite an admitted ledger row', 'duplicate admitted input finding IDs are not allowed', 'every cited admitted reviewer must appear in provenance.submitters', 'provenance.submitters must not contain duplicate reviewers', 'provenance.agreement_credit must not contain duplicate reviewers', 'provenance.agreement_credit must not overlap provenance.submitters', 'provenance.agreement_credit requires an eligible returned persona with admitted evidence', 'satisfied risk coverage must cite an admitted ledger row owned by another persona'];
|
|
7
19
|
export declare const DispatchOutcomeSchema: z.ZodEnum<{
|
|
8
20
|
empty: "empty";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
+
import { type SchemaRejection } from './review-artifact-path.js';
|
|
2
3
|
import type { HarnessSchema } from './review-artifact-schema.js';
|
|
3
4
|
import { type AdjudicationEnvelopeSchema, type FinalizeInputSchema, FinalizeOutputSchema, MergeOutputSchema, type PipelineRoute, type PlanAssessmentEnvelopeSchema, PrepareOutputSchema, ScreenOutputSchema, type ValidatorLifecycleResultsSchema } from './review-pipeline-contract.js';
|
|
4
5
|
/**
|
|
@@ -47,13 +48,19 @@ export type PrepareOutput = ReturnType<typeof PrepareOutputSchema.parse>;
|
|
|
47
48
|
export interface PrepareReviewCandidatesInput {
|
|
48
49
|
readonly raw_input: unknown;
|
|
49
50
|
}
|
|
50
|
-
type PrepareRejectReason =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export
|
|
51
|
+
type PrepareRejectReason = `aggregate payload exceeds the byte cap (${number} bytes)` | 'malformed JSON' | 'schema validation' | 'prepare output failed schema validation' | 'duplicate persona outcome' | 'duplicate input id' | 'unselected persona screen result' | 'missing screen result for selected dispatch';
|
|
52
|
+
type PrepareSchemaReason = 'schema validation' | 'prepare output failed schema validation';
|
|
53
|
+
type PrepareDomainReason = Exclude<PrepareRejectReason, PrepareSchemaReason>;
|
|
54
|
+
export type { SchemaRejection };
|
|
55
|
+
/** A domain rejection: a fixed reason code and a safe JSON path only. */
|
|
56
|
+
interface DomainRejection<Reason extends string> {
|
|
57
|
+
readonly kind: 'domain';
|
|
54
58
|
readonly path: string;
|
|
55
|
-
readonly reason:
|
|
59
|
+
readonly reason: Reason;
|
|
56
60
|
}
|
|
61
|
+
/** One bounded, payload-safe rejection diagnostic. Never payload content,
|
|
62
|
+
* never exception text. */
|
|
63
|
+
export type PrepareRejection = DomainRejection<PrepareDomainReason> | SchemaRejection<PrepareSchemaReason>;
|
|
57
64
|
export type PrepareReviewCandidatesResult = {
|
|
58
65
|
readonly ok: true;
|
|
59
66
|
readonly value: PrepareOutput;
|
|
@@ -102,11 +109,12 @@ export interface ValidatedAdjudication {
|
|
|
102
109
|
readonly declined: readonly ValidatedDeclinedSingleton[];
|
|
103
110
|
readonly singletons: readonly string[];
|
|
104
111
|
}
|
|
105
|
-
type AdjudicationRejectReason = 'unknown input id' | 'suppressed input id' | 'duplicate input id citation' | 'omitted eligible input id' | 'cross-group input id citation' | 'representative line mismatch' | 'unexpected decisions for empty candidate set' | 'duplicate merged group decision id' | 'duplicate declined decision id' | 'duplicate passthrough singleton input id' | 'declined decision id collides with merged group decision id' | 'declined decision id collides with passthrough singleton input id' | 'passthrough singleton input id collides with merged group decision id';
|
|
112
|
+
type AdjudicationRejectReason = 'unknown input id' | 'suppressed input id' | 'duplicate input id citation' | 'omitted eligible input id' | 'cross-group input id citation' | 'representative line mismatch' | 'unexpected decisions for empty candidate set' | 'duplicate merged group decision id' | 'duplicate declined decision id' | 'duplicate passthrough singleton input id' | 'declined decision id collides with merged group decision id' | 'declined decision id collides with passthrough singleton input id' | 'passthrough singleton input id collides with merged group decision id' | 'prepared survivor missing for input id' | 'prepared survivor missing from the partition' | 'duplicate prepared survivor input id' | 'duplicate candidate group member' | 'singleton input id is also a candidate group member';
|
|
106
113
|
/** One bounded, payload-safe rejection diagnostic: a fixed reason code and a
|
|
107
114
|
* safe JSON path only. Never payload content, never a finding title, never
|
|
108
115
|
* exception text. */
|
|
109
116
|
export interface AdjudicationRejection {
|
|
117
|
+
readonly kind: 'domain';
|
|
110
118
|
readonly path: string;
|
|
111
119
|
readonly reason: AdjudicationRejectReason;
|
|
112
120
|
}
|
|
@@ -182,6 +190,7 @@ type MergedFindingRejectReason = 'route widening' | 'route narrowing missing rea
|
|
|
182
190
|
* safe JSON path only. Never payload content, never a finding title, never
|
|
183
191
|
* exception text. */
|
|
184
192
|
export interface MergedFindingRejection {
|
|
193
|
+
readonly kind: 'domain';
|
|
185
194
|
readonly path: string;
|
|
186
195
|
readonly reason: MergedFindingRejectReason;
|
|
187
196
|
}
|
|
@@ -215,7 +224,7 @@ export type ApplyReviewAdjudicationResult = {
|
|
|
215
224
|
readonly value: MergeOutput;
|
|
216
225
|
} | {
|
|
217
226
|
readonly ok: false;
|
|
218
|
-
readonly rejection: AdjudicationRejection | MergedFindingRejection
|
|
227
|
+
readonly rejection: AdjudicationRejection | MergedFindingRejection | SchemaRejection<'merge output failed schema validation'>;
|
|
219
228
|
};
|
|
220
229
|
/**
|
|
221
230
|
* The top-level merge phase: validates the adjudication partition, derives
|
|
@@ -281,6 +290,7 @@ type ReconcileValidatorResultsRejectReason = 'missing validator result' | 'dupli
|
|
|
281
290
|
/** One bounded, payload-safe rejection diagnostic: a fixed reason code and a
|
|
282
291
|
* safe JSON path only. Never payload content, never a finding title. */
|
|
283
292
|
export interface ReconcileValidatorResultsRejection {
|
|
293
|
+
readonly kind: 'domain';
|
|
284
294
|
readonly path: string;
|
|
285
295
|
readonly reason: ReconcileValidatorResultsRejectReason;
|
|
286
296
|
}
|
|
@@ -326,8 +336,9 @@ export interface FinalizeContext {
|
|
|
326
336
|
readonly rejected_payloads: readonly RejectedPayloadWeight[];
|
|
327
337
|
readonly lost_risk_critical_personas: readonly LostRiskCriticalPersona[];
|
|
328
338
|
}
|
|
329
|
-
type FinalizeContextRejectReason = 'duplicate merged finding ID' | 'merged finding references unknown survivor' | 'survivor missing from merge inputs' | 'survivor claimed by multiple merged findings' | 'validator request references unknown merged finding' | 'dispatch record mismatch' | 'duplicate selection surface entry' | 'screen result missing for selected persona' | 'unexpected screen result for persona' | 'screen result outcome does not match dispatch record' | 'merged finding fields diverge from derivation' | 'merged finding route narrowing reason mismatch' | 'confidence disposition references unscreened finding' | 'merged finding cites input from unavailable reviewer' | 'merged finding submitter not a cited reviewer' | 'merged finding agreement credit overlaps submitters' | 'surviving finding diverges from its screened finding' | 'surviving finding references unscreened input' | 'duplicate confidence disposition' | 'validation must be not_attempted at finalize';
|
|
339
|
+
type FinalizeContextRejectReason = 'duplicate merged finding ID' | 'merged finding references unknown survivor' | 'survivor missing from merge inputs' | 'survivor claimed by multiple merged findings' | 'validator request references unknown merged finding' | 'dispatch record mismatch' | 'duplicate selection surface entry' | 'screen result missing for selected persona' | 'unexpected screen result for persona' | 'screen result outcome does not match dispatch record' | 'merged finding fields diverge from derivation' | 'merged finding route narrowing reason mismatch' | 'confidence disposition references unscreened finding' | 'merged finding cites input from unavailable reviewer' | 'merged finding submitter not a cited reviewer' | 'merged finding agreement credit overlaps submitters' | 'surviving finding diverges from its screened finding' | 'surviving finding references unscreened input' | 'duplicate confidence disposition' | 'screened finding lacks exactly one confidence disposition' | 'validation must be not_attempted at finalize';
|
|
330
340
|
export interface FinalizeContextRejection {
|
|
341
|
+
readonly kind: 'domain';
|
|
331
342
|
readonly path: string;
|
|
332
343
|
readonly reason: FinalizeContextRejectReason;
|
|
333
344
|
}
|
|
@@ -443,6 +454,7 @@ export interface FinalizeReviewDispositionsOutput {
|
|
|
443
454
|
}
|
|
444
455
|
type FinalizeReviewDispositionsRejectReason = 'survivor missing from merged findings';
|
|
445
456
|
export interface FinalizeReviewDispositionsRejection {
|
|
457
|
+
readonly kind: 'domain';
|
|
446
458
|
readonly path: string;
|
|
447
459
|
readonly reason: FinalizeReviewDispositionsRejectReason;
|
|
448
460
|
}
|
|
@@ -656,6 +668,7 @@ export interface ReviewCoverageSummary {
|
|
|
656
668
|
}
|
|
657
669
|
type BuildReviewCoverageRejectReason = 'coverage array exceeds bound';
|
|
658
670
|
export interface BuildReviewCoverageRejection {
|
|
671
|
+
readonly kind: 'domain';
|
|
659
672
|
readonly path: string;
|
|
660
673
|
readonly reason: BuildReviewCoverageRejectReason;
|
|
661
674
|
}
|
|
@@ -673,7 +686,7 @@ export type BuildReviewCoverageResult = {
|
|
|
673
686
|
* `never_returned`, or `validation_unavailable`; the disproving reasons for
|
|
674
687
|
* every requested validator that never answered; and the merge phase's
|
|
675
688
|
* disagreement facts, carried through unchanged. Every array is checked
|
|
676
|
-
* against `
|
|
689
|
+
* against `COVERAGE_BOUNDS` before assembly -- an overflow rejects rather than
|
|
677
690
|
* silently truncating. Never reads `process.env`, the filesystem, or the
|
|
678
691
|
* clock.
|
|
679
692
|
*/
|
|
@@ -719,13 +732,7 @@ export interface ProjectSynthesizedFindingsInput {
|
|
|
719
732
|
export declare function projectSynthesizedFindings(input: ProjectSynthesizedFindingsInput): readonly SynthesizedFindingProjection[];
|
|
720
733
|
export type FinalizeReviewInput = FinalizeInputValue;
|
|
721
734
|
type FinalizeOutputValue = ReturnType<typeof FinalizeOutputSchema.parse>;
|
|
722
|
-
type FinalizeReviewRejection = FinalizeContextRejection | ReconcileValidatorResultsRejection | FinalizeReviewDispositionsRejection | BuildReviewCoverageRejection | RiskCoverageSemanticsRejection | DispositionLedgerReconciliationRejection |
|
|
723
|
-
readonly path: string;
|
|
724
|
-
readonly reason: 'artifact failed schema validation';
|
|
725
|
-
} | {
|
|
726
|
-
readonly path: string;
|
|
727
|
-
readonly reason: 'finalize output failed schema validation';
|
|
728
|
-
};
|
|
735
|
+
type FinalizeReviewRejection = FinalizeContextRejection | ReconcileValidatorResultsRejection | FinalizeReviewDispositionsRejection | BuildReviewCoverageRejection | RiskCoverageSemanticsRejection | DispositionLedgerReconciliationRejection | SchemaRejection<'artifact failed schema validation'> | SchemaRejection<'finalize output failed schema validation'>;
|
|
729
736
|
export type FinalizeReviewResult = {
|
|
730
737
|
readonly ok: true;
|
|
731
738
|
readonly value: FinalizeOutputValue;
|
|
@@ -752,6 +759,7 @@ interface RiskCoverageSemanticsInput {
|
|
|
752
759
|
readonly risk_coverage?: readonly ArtifactRiskCoverageEntry[];
|
|
753
760
|
}
|
|
754
761
|
interface RiskCoverageSemanticsRejection {
|
|
762
|
+
readonly kind: 'domain';
|
|
755
763
|
readonly path: string;
|
|
756
764
|
readonly reason: 'satisfied risk coverage must cite a validated finding on the lost persona selection surface';
|
|
757
765
|
}
|
|
@@ -778,6 +786,7 @@ type RiskCoverageSemanticsResult = {
|
|
|
778
786
|
*/
|
|
779
787
|
export declare function checkRiskCoverageSemantics(artifactCandidate: RiskCoverageSemanticsInput): RiskCoverageSemanticsResult;
|
|
780
788
|
interface DispositionLedgerReconciliationRejection {
|
|
789
|
+
readonly kind: 'domain';
|
|
781
790
|
readonly path: string;
|
|
782
791
|
readonly reason: 'disposition counts do not reconcile with the admitted input ledger';
|
|
783
792
|
}
|
|
@@ -816,4 +825,3 @@ export declare function checkDispositionCountsReconcileLedger(dispositionCounts:
|
|
|
816
825
|
* partial output. Never reads `process.env`, the filesystem, or the clock.
|
|
817
826
|
*/
|
|
818
827
|
export declare function finalizeReview(input: FinalizeReviewInput): FinalizeReviewResult;
|
|
819
|
-
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MAX_PROJECTED_ISSUE_LINES, type ProjectedIssue } from './review-artifact-path.js';
|
|
1
2
|
/**
|
|
2
3
|
* Bounded, no-write structural validator for a single raw `ce:review` persona
|
|
3
4
|
* return read from stdin.
|
|
@@ -10,8 +11,7 @@
|
|
|
10
11
|
export declare const VALIDATE_REVIEW_RETURN_USAGE = "Usage: systematic validate-review-return";
|
|
11
12
|
/** Input cap in bytes. Reads stop at {@link MAX_REVIEW_RETURN_BYTES} plus one. */
|
|
12
13
|
export declare const MAX_REVIEW_RETURN_BYTES: number;
|
|
13
|
-
|
|
14
|
-
export declare const MAX_PROJECTED_ISSUE_LINES = 8;
|
|
14
|
+
export { MAX_PROJECTED_ISSUE_LINES };
|
|
15
15
|
export declare const REVIEW_RETURN_VALID_MESSAGE = "Review return is valid";
|
|
16
16
|
export declare const REVIEW_RETURN_EMPTY_MESSAGE = "Review return is empty";
|
|
17
17
|
export declare const REVIEW_RETURN_INVALID_UTF8_MESSAGE = "Review return is not valid UTF-8";
|
|
@@ -20,10 +20,7 @@ export declare const REVIEW_RETURN_OVERSIZED_MESSAGE = "Review return exceeds th
|
|
|
20
20
|
export declare const REVIEW_RETURN_READ_FAILED_MESSAGE = "Review return could not be read from stdin";
|
|
21
21
|
export declare const REVIEW_RETURN_TTY_MESSAGE = "validate-review-return reads one JSON document from stdin; interactive input is not supported";
|
|
22
22
|
/** One bounded, payload-safe projected validation issue. */
|
|
23
|
-
export
|
|
24
|
-
readonly path: string;
|
|
25
|
-
readonly code: string;
|
|
26
|
-
}
|
|
23
|
+
export type ReviewReturnIssue = ProjectedIssue;
|
|
27
24
|
export type ReviewReturnValidation = {
|
|
28
25
|
readonly ok: true;
|
|
29
26
|
} | {
|